#pragma once

#ifndef ITERATIVE_DFS_MULTIPLE_CYCLE_FINDER_ALGORITHM
#define ITERATIVE_DFS_MULTIPLE_CYCLE_FINDER_ALGORITHM

/*! \file IterativeDFSMultipleCycleFinderAlgorithm.h
	\brief Header file for IterativeDFSMultipleCycleFinderAlgorithm class.
	
	Details.
*/

#include <vector>

#include "Graph.h"
#include "AbstractCycleFinderAlgorithm.h"

namespace analyzer {
	
	//! This class implements iterative Depth-first search (DFS) algorithm to searchimg graph.
	class IterativeDFSMultipleCycleFinderAlgorithm : public AbstractCycleFinderAlgorithm
	{
	public:
		/*! \fn IterativeDFSMultipleCycleFinderAlgorithm(void)
			\brief Constructor of class IterativeDFSMultipleCycleFinderAlgorithm
		*/
		IterativeDFSMultipleCycleFinderAlgorithm(void);
		/*! \fn IterativeDFSMultipleCycleFinderAlgorithm(void)
			\brief Destructor of class IterativeDFSMultipleCycleFinderAlgorithm
		*/
		~IterativeDFSMultipleCycleFinderAlgorithm(void);

		/*! \fn bool getFailOnFirst() const
			\brief Returns the value responsible for stopping algorithm.
			\return Value responsible for stopping algorithm..
		*/
		
		bool getFailOnFirst() const;
		/*! \fn void setFailOnFirst(bool failOnFirst)
			\brief Sets the value responsible for stopping algorithm.
			\param failOnFirst True value makes algorithm stop.
		*/
		void setFailOnFirst(bool failOnFirst);

		virtual std::vector<std::vector<int> > findCycle(const Graph& graph);

	private:		
		std::vector<int> getCyclicVertices(Vertex searchVertex, Vertex startVertex, std::map<Vertex, Vertex> parentVertex);

		bool failOnFirst;
	};
}

#endif // ITERATIVE_DFS_MULTIPLE_CYCLE_FINDER_ALGORITHM

